import { createRouter, createWebHashHistory } from 'vue-router'
import layout from '@/layout/index.vue'

const routes = [
  {
    name: 'login',
    path: '/login',
    hidden: true,
    component: () => import('@/views/Login'),

    children: [{
      path: '/Login/:path(.*)',
      hidden: true,
      component: () => import('@/views/Login'),
    }
    ]
  },
  {
    name: 'register',
    path: '/register',
    component: () => import('@/views/register'),
    hidden: true
  },
  {
    path: '/404',
    component: () => import('@/views/error/404'),
    hidden: true
  },
  {
    path: '/401',
    component: () => import('@/views/error/401'),
    hidden: true
  },
  {
    path: '',
    component: layout,
    children: [{
      name: 'home',
      path: '/home',
      component: () => import('@/views/Home.vue')
    },
    {
      path: '/course',
      name: 'course',
      component: ()=>import('@/views/Course.vue'),
    }, {
      path: '/users',
      name: 'users',
      component: () => import('@/views/Users.vue'),
    },
    {
      path: '/labs',
      name: 'labs',
      component: () => import('@/views/Labs.vue'),
    },
    {
      path: '/sessions',
      name: 'sessions',
      component: () => import('@/views/Sessions.vue'),
    },
    {
      path: '/messages',
      name: 'messages',
      component: () => import('@/views/Messages.vue'),
    },
    {
      path: '/statistics',
      name: 'statistics',
      component: () => import('@/views/Statistics.vue'),
    },
    {
      path: '/demands',
      name: 'demands',
      component: () => import('@/views/Demands.vue'),
    }
    ]
  },
]

export const router = createRouter({
  history: createWebHashHistory(),
  routes
})


